This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 16, 2011, 1:04 PM
23 Posts

Re: Dynamic value binding

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Dynamic Design,datasource
  • Replies: 5
 
I have many controls that do this and I have tried several different techniques over the years based on what I saw on blogs, presentations, etc.

Here is what is working for me...
 
1. Put the field on a Custom Control
2. Add string property to the Custom Control
3. Set the binding to get the field name from the property.
4. Provide the value to the string property when it is used (works fine in a repeat control).

Example:
 
<xp:radioGroup id="radioGroup2">
        <xp:this.value><![CDATA[#{document1[compositeData.fieldName]}]]></xp:this.value>
        <xp:selectItems id="selectItems2">
            <xp:this.value><![CDATA[#{javascript:@DbLookup(blahblahblah)}]]></xp:this.value>
        </xp:selectItems>
    </xp:radioGroup>
 
 
I know others have said you could also  dynamically set the data source but I have tried many different versions of that and have not been successful.
 
If anyone has  a working bit of code they could post that would be fantastic.
Jun 21, 2011, 10:14 PM
8 Posts
Re: Dynamic value binding
One idiosyncrasy that I found maddening ... to successfully bind the data source you need to specify as a simple binding. As such, this works fine   
 
<xp:this.value><![CDATA[#{document1[compositeData.fieldName]}]]></xp:this.value>
 
Whereas this does not 
 
<xp:this.value><![CDATA[#{javascript:document1[compositeData.fieldName]}]]></xp:this.value> 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal